/* 是否是对象 */
export const isObject = (val) => val !== null && typeof val === 'object';
/* 是否是数组 */
export const isArray = Array.isArray;
/* 是否是数字 */
export const isNumber = (val) => !isNaN(parseFloat(val)) && isFinite(val);
/* 是否是空对象 */
export const isEmptyObject = (obj) => Object.keys(obj).length === 0;
/* 是否是字符串 */
export const isString = (val) => typeof val === 'string';
/* 是否是函数 */
export const isFunction = (val) => typeof val === 'function';
/* 对象深拷贝 */
export const deepCopy = (obj) => JSON.parse(JSON.stringify(obj));

/* 检查图片类型 */
export const chackImageType = (name) => /\/(gif|jpg|jpeg|png)$/i.test(name);
/* 检查视频类型 */
export const chackVideoType = (name) => /\/(mp4|avi|quicktime)$/i.test(name);